<?php
/**
* @file Basicm.php
* @synopsis  基础信息存贮
* @author Yee, <rlk002@gmail.com>
* @version 1.0
* @date 2015-03-13 16:47:32
*/

defined('BASEPATH') OR exit('No direct script access allowed');

class Basicm extends CI_Model
{
	function __construct()
	{

	}

	public function insert($indata)
	{
		//首先判断用户是否为老用户
		$is_old = $this->db->select('1')->where('idfa',$indata['idfa'])->where('mac',$indata['mac'])->get("ml_idfa", 1)->result_array();
		if(!$is_old)
		{
			$indata['id_type'] = 1;
			$indata['addtime'] = time();
			$indata['uid'] = $this->uid ? $this->uid : "";
			$this->db->insert('ml_idfa',$indata);
			$this->db->insert("ml_idfa_login_log",$indata);
		}
		else
		{
			$indata['id_type'] = 0;
			$indata['addtime'] = time();
			$indata['uid'] = $this->uid ? $this->uid : "";
			$this->db->insert("ml_idfa_login_log",$indata);
		}
	}


}
